import 'package:car_map/page/groupingpage/device_page.dart';
import 'package:car_map/page/groupingpage/label_page.dart';
import 'package:flutter/material.dart';

///分组
class GroupingPage extends StatefulWidget {
  @override
  _groupingPage createState() => _groupingPage();
}

class _groupingPage extends State<GroupingPage>
    with SingleTickerProviderStateMixin {
  List<Tab> tabList = [
    Tab(
      text: '设备',
    ),
    Tab(
      text: '标注',
    ),
  ];

  TabController controller;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    controller=new TabController(length: tabList.length, vsync: this,);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
    controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: TabBar(tabs: tabList,controller: controller,),
      ),
      body: Container(
        child: TabBarView(
          children: <Widget>[
            DevicePage(),
            LabelPage()],
          controller: controller,
        ),
      ),
    );
  }
}
